<?php

namespace Worker\Controller;

use Worker\Logic;

class UCenterController extends WorkerBaseController
{
    private $userLogic;
    public function _initialize()
    {
        parent::_initialize();
        $this->userLogic = new Logic\UserLogic();
    }

    public function edit()
    {
        $userInfo = $this->getUserInfo();
        $this->assign("userInfo", $userInfo);
        $this->display();
    }

    public function doEdit()
    {
        $data = I('post.');
        
        $userInfo = $this->getUserInfo();
        $userId = $userInfo["id"];

        $res = $this->userLogic->editUser($userId, $data);
        $this->ajaxReturn($res);
    }
}
